<?php
/**
 * Created by PhpStorm.
 * User: 86188
 * Date: 2020/12/19
 * Time: 16:58
 */

namespace app\service;


use think\facade\Db;
use think\facade\Cache;

class webService
{
    public function webinfo(){
        return Db::table("webset")->where("id","1")->find();
    }
    public function getPayStatus(){
        if(!Cache::has('webset_pay_status')){
            return false;
        }else{
            return Cache::get('webset_pay_status');
        }
    }
    public function setPayStatus($data){
        Cache::set('webset_pay_status',$data);
    }
    public function getNotifyurlAlipay(){
        if(!Cache::has('webset_notifyurl_alipay')){
            $webinfo=$this->webinfo();
            Cache::set('webset_notifyurl_alipay',$webinfo['notifyurl_alipay']);
            return $webinfo['notifyurl_alipay'];
        }else{
            return Cache::get('webset_notifyurl_alipay');

        }

    }
    public function getNotifyurlWechat(){
        if(!Cache::has('webset_notifyurl_wechat')){
            $webinfo=$this->webinfo();
            Cache::set('webset_notifyurl_wechat',$webinfo['notifyurl_wechat']);
            return $webinfo['notifyurl_wechat'];
        }else{
            return Cache::get('webset_notifyurl_wechat');

        }
    }
}